package ar.edu.utn.frsf.proyectofinal.sistemadecontrolmodbus.presentation.controller.admin.devtypes;

import java.util.ArrayList;
import java.util.List;

import ar.edu.utn.frsf.proyectofinal.sistemadecontrolmodbus.persistence.model.CompoundCommand;

public class CompoundCommandBean {
	private CompoundCommand cmd;

	public CompoundCommandBean(CompoundCommand cmd) {
		this.cmd = cmd;
	}
	
	public String getName() {
		return cmd.getName();
	}

	public void setName(String name) {
		cmd.setName(name);
	}

	public Integer getAddress() {
		return cmd.getAddress();
	}

	public void setAddress(Integer address) {
		cmd.setAddress(address);
	}

	
	public static List<CompoundCommandBean> wrap(	List<CompoundCommand> compoundCommands) {

		List<CompoundCommandBean> ret = new ArrayList<CompoundCommandBean>();
		for (CompoundCommand cmd : compoundCommands) {
			ret.add(new CompoundCommandBean(cmd));
		}
		return ret;
	}

	public CompoundCommand getCommand() {
		return cmd;
		
	}
}
